using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Transactions;
using NUnit.Framework;
using log4net;
using log4net.Appender;
using log4net.Config;

namespace Uber.Test
{
    [TestFixture]
    public class IntegrationTestsBase
    {
        private TransactionScope scope;

        [TestFixtureSetUp]
        public void FixtureStart()
        {
            XmlConfigurator.Configure();
        }

        //[Test]
        public void Log4NetConfigurationLoaded()
        {
            IAppender[] appenders = LogManager.GetRepository().GetAppenders();
            ICollection appenderNames = appenders.Select(appender => appender.Name).ToArray();
            Assert.Contains("RollingFile", appenderNames);
        }

        [SetUp]
        public virtual void Initialize()
        {
            scope = new TransactionScope();
        }

        [TearDown]
        public void TestCleanup()
        {
            scope.Dispose();
        }
    }
}